<?php
namespace Fyfyu\Admin\Controllers;

use Hyperf\Di\Annotation\Inject;
use Fyfyu\Admin\Annotations\AdminController;
use Fyfyu\Admin\Controller;
use Fyfyu\Admin\Models\AdminUser;
/**
 * @AdminController(prefix="user")
 */
class AdminUserController extends Controller{

    /**
     * @Inject()
     * @var AdminUser
     */
    protected $model;

    protected $title = '用户';

    protected function grid(){
        $this->grid->model()->where('id','>',1);
        $this->grid->column('username');
        $this->grid->column('username');
        $this->grid->column('roles.description');
        $this->grid->password('密码');
        $this->grid->avatar('头像')->image(50);
        $this->grid->created_at('创建时间');
    }

    protected function form(){
        $this->form->text('username');
        $this->form->password('password','密码')->confirm('确认密码');
        // $this->form->image('avatar')->width(100)->upload('http://www.baidu.com');
        // $this->form->timestamps();
    }

}
